package com.yunji.base.service;


import com.yunji.base.convert.SuggestConvert;
import com.yunji.base.dao.ISuggestDao;
import com.yunji.base.domain.SuggestDO;
import com.yunji.base.dto.SuggestReadDTO;
import com.yunji.common.model.dto.MemberSuggestDTO;
import com.yunji.common.model.params.SuggestParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Project: yunji-coffee
 * @Package: com.yunji.message.service
 * @Title: SuggestService
 * <p>
 * History:
 * Date                     Version     Author          Summary
 * ============================================================
 * 2024-10-30 17:42:51      V1.0        HuaAo       新建类
 */
@Service
@Slf4j
public class SuggestService {

    @Resource
    ISuggestDao suggestDao;

    public boolean create(MemberSuggestDTO dto) {
        SuggestDO suggest = SuggestConvert.convertMemberDto(dto);
        return suggestDao.save(suggest);
    }

    public List<SuggestDO> searchPageList(SuggestParam param) {
        return suggestDao.searchPageList(param);
    }

    public boolean delete(List<Long> ids) {
        return suggestDao.removeBatchByIds(ids);
    }

    public List<String> searchTableField(SuggestParam param) {
        return suggestDao.searchTableField(param);
    }

    public List<SuggestDO> search(SuggestParam param) {
        return suggestDao.search(param);
    }

    public boolean updateReadStatus(SuggestReadDTO dto) {
        return suggestDao.updateReadStatus(dto);
    }
}